<?php
namespace DAOZHEN\D;
class Admin_TablesB extends \ZHMVC\D\DataBase
{ 
    public function add($qianzui, $pathname1, $pathname2, $modulename, $moduleid, $mulu, $rpcpathname, $rpctype = '本地', $rpcurl = '', $rpcmainkey = '',$rpchost='',$rpcprivatekey='',$rpcmoduleid=1)
    {
        //6，用户分享日志表
        $tablename="tongbu";
        $sql = "CREATE TABLE `".$qianzui.$tablename."` (
              `id` char(20)  NOT NULL COMMENT 'id',
              `openid` varchar(250) NULL DEFAULT '' COMMENT 'openid',
              `name` varchar(250) NULL DEFAULT NULL COMMENT '姓名',
              `shenfenzheng` varchar(250) NULL DEFAULT NULL COMMENT '身份证号',
              `istongbu` char(10) NULL DEFAULT '否' COMMENT '是否同步了',
              `addtime` varchar(255)  NULL DEFAULT '' COMMENT '同步时间',
              PRIMARY KEY (`id`)
            );";
        
        $this->_db->update($sql);
        
        // 添加模块类表
        $mt = new \ZHMVC\D\ModuleTable();
        $mt->add($moduleid, ucwords($tablename));
        // 生成伪表文件
        $tf = new \ZHMVC\B\TOOL\TableToFile($qianzui, $tablename, $pathname1, $pathname2, ucwords($tablename), "admin_" . strtolower($tablename), $modulename,$rpctype, $rpcurl, $rpcmainkey, $rpchost, $rpcprivatekey, $rpcmoduleid);
        $tf->parse();
        $tf->saveContent();
        return 1;
    }
}
